﻿/**
* 命名空间: ICS_TricolorLamp
* 功 能： 三色灯
* 类 名： WarningLight
*
* Ver 变更日期 负责人 变更内容
* ───────────────────────────────────
* V0.01 2021/9/15 11:25:11 小柚子爱学习 初版
*
* Copyright (c) 2021 Lir Corporation. All rights reserved.
*┌──────────────────────────────────┐
*│　此技术信息为个人机密信息，未经本人书面同意禁止向第三方披露．　│
*│　版权所有：Vip_Future 　　　　　　　　　　　　　　│
*└──────────────────────────────────┘
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ICS_TricolorLamp
{
    /// <summary>
    /// WarningLight.xaml 的交互逻辑
    /// </summary>
    public partial class WarningLight : UserControl
    {
        public LightState LightState
        {

            get { return (LightState)GetValue(LightStateProperty); }
            set { SetValue(LightStateProperty, value); }
        }
        public static readonly DependencyProperty LightStateProperty =
           DependencyProperty.Register("LightState", typeof(LightState), typeof(WarningLight), new PropertyMetadata(LightState.None,new PropertyChangedCallback(OnlightTypeChanged)));

        public WarningLight()
        {
            InitializeComponent();
        }
        public static void OnlightTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
            //执行视觉状态的更新
            VisualStateManager.GoToState(d as WarningLight, e.NewValue.ToString(), false);
        }
      
    }
    //三色灯状态值
    public enum LightState
    {
        None, Fault, Warning, Run
    }
}
